package HashBuck;

import java.util.Objects;

class Student{
    public int id;

    public Student(int id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return id == student.id;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
public class Test {
    public static void main(String[] args) {
        HashBuck2<Student,Integer> hashBuck2=new HashBuck2<Student,Integer>();
        Student student1=new Student(21321654);
        Student student2=new Student(21321654);

        hashBuck2.put(student1,2);
        System.out.println(hashBuck2.get(student2));
    }

    public static void main01(String[] args) {
        HashBuck hashBuck=new HashBuck();
        hashBuck.put(1,11);
        hashBuck.put(2,22);
        hashBuck.put(19,99);
        hashBuck.put(5,55);
        hashBuck.put(6,66);
        hashBuck.put(7,77);
        hashBuck.put(8,888);
        hashBuck.put(4,44);

        System.out.println(hashBuck.get(1));
    }
}
